package org.jeecg.enums;

import lombok.Getter;

/**
 * ENUM: 性别
 */
@Getter
public enum Gender {

    MALE("先生", 0),
    FEMALE("女士", 1),
    UNKNOWN("同志", 2),
    ;

    private final String label;
    private final Integer value;

    Gender(String label, Integer value) {
        this.label = label;
        this.value = value;
    }

    public static Gender of(Integer value) {
        for (Gender type : Gender.values()) {
            if (type.value == value) {
                return type;
            }
        }
        return null;
    }
}

